package com.lgc.javathread.locktest.interruptTest.interruptTest2;

public class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println("i=" + (i + 1));

            if (this.isInterrupted()) {
                System.out.println("通过this.isInterrupted()检测到中断");
                System.out.println("第一个interrupted()" + Thread.interrupted());
                System.out.println("第二个interrupted()" + Thread.interrupted());
                break;
            }
        }
    }

}
